#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <yaml-cpp/yaml.h>

using namespace YAML;
using namespace std;

int main()
{
  YAML::Node config = YAML::LoadFile("tests/data/YamlReader.yaml");

  cout << config["product"].size() << endl;
  for(auto node : config["product"])
    cout << node.IsMap() << endl;

  cout << endl;
  cout << config.Tag() << endl;
  cout << !config["invoice"] << endl;
  cout << config["non-existing"].IsDefined() << endl;
  cout << config["non-existing"].IsMap() << endl;
  cout << config["non-existing"].IsNull() << endl;
  cout << config["non-existing"].IsScalar() << endl;
  cout << config["non-existing"].IsSequence() << endl;
  cout << endl;

  cout << config["invoice"] << endl;
  cout << config["product"][0]["quantity"].as<double>() << endl;
  cout << endl;
  cout << config["product"][0].IsDefined() << endl;
  cout << config["product"][0].IsMap() << endl;
  cout << config["product"][0].IsNull() << endl;
  cout << config["product"][0].IsScalar() << endl;
  cout << config["product"][0].IsSequence() << endl;
  cout << endl;
  cout << config["product"].IsDefined() << endl;
  cout << config["product"].IsMap() << endl;
  cout << config["product"].IsNull() << endl;
  cout << config["product"].IsScalar() << endl;
  cout << config["product"].IsSequence() << endl;

  cout << config["comments"] << endl;
  return 1;
}